/*
 * RTSAI - Real-Time Strategy engine for AI research
 * Copyright(C) 2006 DIMAp-UFRN, licensed under LGPL
 *
 * Game event
 */

#ifndef GAMEEVENT_H
#define GAMEEVENT_H

#include "Common.h"

/*! Abstract class (or struct) that events may add elements. It is a
 *  super-class of every data passed to event callbacks.
 */
class GameEventData
{
    // data elements will be insert by script
};

/*! Abstract class that representing a game event type.
 */
class GameEvent
{
    public:
        GameEvent ();
        GameEvent ( const string &event_name );
        virtual ~GameEvent ();

        const string& get_name () const { return name; }
        virtual GameEventData* check () const { return false; }

        void notify_listeners ( GameEventData* );
        void add_listener ( UnitState *state );
        void remove_listener ( UnitState *state );

    private:
        string name;
        StateList listeners;
};

#endif // GAMEEVENT_H
